﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Text;
using Tools.Data;

namespace Tools.Service
{
    public class UserInfoService: Entities
    {
        /// <summary>
        /// 获取单个用户
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public UserInfo GetUserInfo(int id)
        {
            return Client.Queryable<UserInfo>().First(t => t.Id == id);
        }

        /// <summary>
        /// 保存用户
        /// </summary>
        /// <param name="user"></param>
        /// <returns></returns>
        public int SaveUserInfo(UserInfo user)
        {
            return Client.Insertable<UserInfo>(user).ExecuteCommand();
        }
    }
}
